package com.xcity.game.combat.skill.impl;

import com.xcity.game.combat.Action;
import com.xcity.game.combat.ActionEffect;
import com.xcity.game.combat.CombatUtils;
import com.xcity.game.combat.skill.CombatSkill;
import com.xcity.game.combat.unit.CombatUnit;
import com.xcity.game.common.GameStaticConfig;
import com.xcity.game.skill.Skill;

/**
 * 披荆斩棘<br/>
 * 对随机一个目标造成{0=180#0}%的技能伤害，并降低{1=50#0}%目标恢复能力，持续{2=2#0}回合
 * @author yang.li
 *
 */
public class COMBAT_SKILL_100002 extends CombatSkill {

	public COMBAT_SKILL_100002(Skill skill) {
		super(skill);
	}

	@Override
	public void calcDamage(Action action) {
//		CombatUnit source = action.unit;
		CombatUnit target = action.target.getUnitRandomly();
		if (target != null) {
			ActionEffect effect = action.addTarget(target);
			CombatUtils.calcMagicAttack(effect, skill.getParameter(0) / GameStaticConfig.percentBase);
		}
	}

}
